package oceanwiki;

import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j;
import org.mapstruct.BeanMapping;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@Slf4j
@MapperScan("oceanwiki.mapper")
@ServletComponentScan
//启动定时
@EnableScheduling
@EnableAsync
public class OceanwikiApplication {

    public static void main(String[] args) {
//        SpringApplication.run(OceanwikiApplication.class, args);

        //读取配置
        SpringApplication app = new SpringApplication(OceanwikiApplication.class);
        Environment environment = app.run(args).getEnvironment();

        log.info("启动成功！");
        log.info("地址：{}, 端口：{}", environment.getProperty("server.address"), environment.getProperty("server.port"));
    }

}
